$("#openback").click(e => {
    window.open(chrome.extension.getURL("back.html"))
})

$("#getbacktitle").click(e => {
    const bg = chrome.extension.getBackgroundPage()
    alert(bg.document.title)
})

$("#setbacktitle").click(e => {
    const title = prompt("请输入后台页新标题", "新标题")
    const bg = chrome.extension.getBackgroundPage()
    bg.document.title = title
    alert(bg.document.title)
})

$("#callbackjs").click(e => {
    var bg = chrome.extension.getBackgroundPage()
    bg.backjs()
})

$("#pop_notify").click(e => {
    chrome.notification.create(null, {
        type: 'text',
        iconUrl: 'img/icon.png',
        title: '弹出框',
        message: '这是一个消息弹出框的内容'
    })
})
